package com.yidu.ruifeng_logistics.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yidu.ruifeng_logistics.entity.LogisticsCar;
import com.yidu.ruifeng_logistics.dao.LogisticsCarDao;
import com.yidu.ruifeng_logistics.service.LogisticsCarService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.function.Function;

/**
 * (LogisticsCar)车辆表服务实现类
 *
 * @author makejava
 * @since 2021-03-09 14:24:36
 */
@Service("logisticsCarService")
public class LogisticsCarServiceImpl implements LogisticsCarService {
    @Resource
    private LogisticsCarDao logisticsCarDao;

    /**
     * 通过ID查询单条数据
     *
     * @param carId 主键
     * @return 实例对象
     */
    @Override
    public LogisticsCar queryById(Integer carId) {
        return this.logisticsCarDao.queryById(carId);
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    @Override
    public List<LogisticsCar> queryAllByLimit(int offset, int limit) {
        return this.logisticsCarDao.queryAllByLimit(offset, limit);
    }

    /**
     * 新增数据
     *
     * @param logisticsCar 实例对象
     * @return 实例对象
     */
    @Override
    public LogisticsCar insert(LogisticsCar logisticsCar) {
        this.logisticsCarDao.insert(logisticsCar);
        return logisticsCar;
    }

    /**
     * 修改数据
     *
     * @param logisticsCar 实例对象
     * @return 实例对象
     */
    @Override
    public LogisticsCar update(LogisticsCar logisticsCar) {
        this.logisticsCarDao.update(logisticsCar);
        return this.queryById(logisticsCar.getCarId());
    }

    /**
     * 通过主键删除数据
     *
     * @param carId 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Integer carId) {
        return this.logisticsCarDao.deleteById(carId) > 0;
    }

    @Override
    public int deleteAllId(String ids) {
        String[] s = ids.split(",");
        return this.logisticsCarDao.deleteAllId(s);
    }

    /**
     * 根据员工id批量删除
     * @param ids
     * @return
     */
    @Override
    public int deleteDriverId(String ids) {
        String[] s = ids.split(",");
        return this.logisticsCarDao.deleteDriverId(s);
    }


    @Override
    public List<LogisticsCar> queryAll(LogisticsCar logisticsCar) {
        return this.logisticsCarDao.queryAll(logisticsCar);
    }

    @Override
    public List<LogisticsCar> queryByStateOrArea(LogisticsCar logisticsCar) {
        return logisticsCarDao.queryByStateOrArea(logisticsCar);
    }

    @Override
    public IPage<LogisticsCar> page(Page<LogisticsCar> page, QueryWrapper<LogisticsCar> wrapper) {
        return null;
    }

    @Override
    public LogisticsCar selectByDriverId(Integer driverId) {
        return logisticsCarDao.selectByDriverId(driverId);
    }

    @Override
    public LogisticsCar checkCarNum(String s) {
        return logisticsCarDao.checkCarNum(s);
    }

    @Override
    public boolean save(Object entity) {
        return false;
    }

    @Override
    public boolean saveBatch(Collection entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdateBatch(Collection entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean removeById(Serializable id) {
        return false;
    }

    @Override
    public boolean remove(Wrapper queryWrapper) {
        return false;
    }

    @Override
    public boolean updateById(Object entity) {
        return false;
    }

    @Override
    public boolean update(Object entity, Wrapper updateWrapper) {
        return false;
    }

    @Override
    public boolean updateBatchById(Collection entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdate(Object entity) {
        return false;
    }

    @Override
    public Object getById(Serializable id) {
        return null;
    }

    @Override
    public Object getOne(Wrapper queryWrapper, boolean throwEx) {
        return null;
    }

    @Override
    public Map<String, Object> getMap(Wrapper queryWrapper) {
        return null;
    }

    @Override
    public int count(Wrapper queryWrapper) {
        return 0;
    }

    @Override
    public List list(Wrapper queryWrapper) {
        return null;
    }

    @Override
    public IPage page(IPage page, Wrapper queryWrapper) {
        return null;
    }

    @Override
    public List<Map<String, Object>> listMaps(Wrapper queryWrapper) {
        return null;
    }

    @Override
    public IPage<Map<String, Object>> pageMaps(IPage page, Wrapper queryWrapper) {
        return null;
    }

    @Override
    public BaseMapper getBaseMapper() {
        return null;
    }

    @Override
    public List listObjs(Wrapper queryWrapper, Function mapper) {
        return null;
    }

    @Override
    public Object getObj(Wrapper queryWrapper, Function mapper) {
        return null;
    }

    @Override
    public Collection listByMap(Map columnMap) {
        return null;
    }

    @Override
    public Collection listByIds(Collection idList) {
        return null;
    }

    @Override
    public boolean removeByIds(Collection idList) {
        return false;
    }

    @Override
    public boolean removeByMap(Map columnMap) {
        return false;
    }
}
